<!DOCTYPE html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="/static/xadmin/css/font.css">
    <link rel="stylesheet" href="/static/xadmin/css/xadmin.css">
    <link rel="stylesheet" href="/static/css/apublic.css">
    <script src="/static/xadmin/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/xadmin/js/xadmin.js"></script>
    <!--[if lt IE 9]>
    <script src="/static/xadmin/html5.min.js"></script>
    <script src="/static/xadmin/respond.min.js"></script>
    <![endif]-->
    <script src="/static/until.js" charset="utf-8"></script>
    <script>
        if(!sessionStorage.getItem('token')) window.top.location.href='/login.html';
    </script>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <blockquote class="layui-elem-quote">欢迎管理员：
                        <span class="x-red" id="username"></span>!  当前时间:<span id="nowtime">2018-04-25 20:50:53</span>
                    </blockquote>
                </div>
            </div>
        </div>
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">数据统计</div>
                <div class="layui-card-body ">
                    <ul class="layui-row layui-col-space10 layui-this x-admin-carousel x-admin-backlog">
                        <li class="layui-col-md2 layui-col-xs6">
                            <a href="javascript:;" class="x-admin-backlog-body">
                                <h3>会员数</h3>
                                <p>
                                    <cite id="user_total"></cite>
                                </p>
                            </a>
                        </li>
                        <li class="layui-col-md2 layui-col-xs6">
                            <a href="javascript:;" class="x-admin-backlog-body">
                                <h3>配置数</h3>
                                <p>
                                    <cite id="systemset_total"></cite>
                                </p>
                            </a>
                        </li>
                        <li class="layui-col-md2 layui-col-xs6">
                            <a href="javascript:;" class="x-admin-backlog-body">
                                <h3>广告数</h3>
                                <p>
                                    <cite id="ad_total"></cite>
                                </p>
                            </a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>

        <style id="welcome_style"></style>
        <div class="layui-col-md12">
            <blockquote class="layui-elem-quote layui-quote-nm"></blockquote>
        </div>
    </div>
</div>
</div>

</body>
<script src="/static/echarts.min.js"></script>
<script src="static/jquery.min.js"></script>
<script>
    //var timeobj=document.getElementById("nowtime");
    //timeobj.innerHTML="s"
    var week=["日","一","二","三","四","五","六"]
    setInterval(function(){
        var date = new Date();
        var year = date.getFullYear();    //获取当前年份
        var mon = date.getMonth()+1;      //获取当前月份
        var da = date.getDate();          //获取当前日
        var day = date.getDay();          //获取当前星期几
        var h = date.getHours();          //获取小时
        var m = date.getMinutes();        //获取分钟
        var s = date.getSeconds();        //获取秒
        var d = document.getElementById('nowtime');
        d.innerHTML=year+'年'+mon+'月'+da+'日'+'星期'+week[day]+' '+h+':'+m+':'+s;
    },1000);

    $("#username").html(sessionStorage.getItem('username'))
    u_post("/index/welcome",null,function(res){
        if(res.status.errorCode==0) {
            $("#user_total").html(res.data.user_total)
            $("#systemset_total").html(res.data.systemset_total)
            $("#ad_total").html(res.data.ad_total)
        }
        else{
            layer.alert(res.status.msg, {icon: 5})
        }
    });
</script>
</html>

